/*
 * @Author: HeAo
 * @Date: 2021-09-30 11:21:58
 * @LastEditTime: 2021-09-30 11:41:56
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2103code\3-1-ES6\day06\2-Object.defineProperty.js
 * 别乱动！
 */
let obj = {}

// Object.defineProperty(obj, 'a', {
//   value: 1,
//   enumerable: true,
//   writable: true,
//   configurable: true
// })

let _value = null;

Object.defineProperty(obj, 'a', {
  enumerable: true,
  configurable: true,
  get () {
    return _value
  },
  set (newValue) {
    _value = newValue
  }
})

obj.a = 1

console.log('obj.a:', obj.a);
